from rest_framework import serializers

from apps.goods.models import SPUSpecification, SPU


##########商品规格################
class SpecsSerializers(serializers.ModelSerializer):
    spu = serializers.StringRelatedField(read_only=True)

    spu_id = serializers.IntegerField()

    class Meta:
        model = SPUSpecification
        fields = "__all__"


# 获取SPU商品信息
class SPUserializers(serializers.ModelSerializer):

    class Meta:
        model = SPU
        fields = ("id","name")
